
const TokenKey = 'leju-admin-token'
const UserInfoKey = 'leju-admin-userInfo'

export function getToken() {
  return JSON.parse(localStorage.getItem(TokenKey))
}

export function setToken(token) {
  return localStorage.setItem(TokenKey, JSON.stringify(token))
}

export function removeToken() {
  return localStorage.removeItem(TokenKey)
}

export function getUserInfo() {
  return JSON.parse(localStorage.getItem(UserInfoKey))
}

export function setUserInfo(token) {
  return localStorage.setItem(UserInfoKey, JSON.stringify(token))
}

export function removeUserInfo() {
  return localStorage.removeItem(UserInfoKey)
}
export function clear() {
  removeToken()
  removeUserInfo()
}

